<include file="Public/head" />
</head>
<include file="Public/common_header" />
    <div class="mian">
        <include file="Public/sidebar" menu='cxtj.lkldz' />
        <div class="mianR">
            <h3 class="yonghu">拉卡拉对账列表</h3>

            <div class="listBox">
                <div class="yuList">
                    <div class="offline">
                        <ul class="clearfix">
                          <form action="/CheckAccounts/detail" method="get">
                              <input type="hidden" name="day" value="{$day}">
                              <li>
                                  <select id="bc_id" name="bc_id" class="tracking_list1" style="color:#7f7f7f">
                                      <option value="-1">请选择分公司</option>
                                      <?php if($branch_id==0):?>
                                      <option value="0">总部</option>
                                      <?php endif;?>
                                  <foreach name="bc_list" item="vo" key="k">
                                      <option value="{$k}" >{$vo}</option>
                                  </foreach>
                                  </select>
                                  <script>$("#bc_id").val("{$bc_id}");</script>
                              </li>
                              <li><input type="text" name="dealer_id" value="{$dealer_id}" placeholder="请输入车商ID" /></li>
                              <li><input type="text" name="real_name" value="{$real_name}" placeholder="请输入联系人" /></li>
                              <li><input type="text" name="mobile" value="{$mobile}" placeholder="请输入联系电话" /></li>
                              <li class="screenBtn" style="margin-top:15px;margin-left:10px;"><input type="submit" value="筛选" /></li>
                          </form>
                            <li class="screenBtn" style="margin-top:15px;margin-left:10px;"><input onclick="window.location.href='/CheckAccounts/detail?day={$day}'"; type="button" value="全部" /></li>
                        </ul>
                    </div>
                    <!--<div class="totalConter" style="padding-top:0;">-->
                        <!--<i>合计：</i>-->
                        <!--记录<b id="fewPens"></b>笔-->
                        <!--<em>金额结算金额</em><b id="settlement"></b>元-->
                        <!--<em>手续费</em><b id="counterFee"></b>元-->
                    <!--</div>-->
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th width="6%">车商ID</th>
                            <th width="6%">分公司</th>
                            <th width="10%">车商信息</th>
                            <th width="7%">订单金额</th>
                            <th width="6%">手续费</th>
                            <th width="14%">商户订单号</th>
                            <th width="12%">拉卡拉订单号</th>
                            <th width="12%">交易时间</th>
                        </tr>
                        </thead>
                        <tbody>
                            <foreach name="list" item="item">
                                <?php $remark = json_decode($item['remark'],true);?>
                                <tr>
                                    <td>{$item.dealer_id}</td>
                                    <td><?php echo $item['branch_name'] ? $item['branch_name'] : "总部"; ?></td>
                                    <td>
                                        姓名: {$item.contact_person} <br/>
                                        电话: {$item.contact_mobile} <br/>
                                    </td>
                                    <td class="counterMoney">{$item.amount}</td>
                                    <td class="settlementMoney">{$remark.data.orderFee}</td>
                                    <td>{$item.order_no}</td>
                                    <td>{$item.transaction_id}</td>
                                    <td>{$item.deal_time}</td>
                                </tr>
                            </foreach>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="pageFaye">{$page}</div>
            <div class="yongBtn1">
                <input type="button" class="quxiao" onclick="window.close()" value="关闭" />
            </div>
        </div>

    </div>

    <div class="clear"></div>
<script type="text/javascript">
    $(document).ready(function() {
        /*线下合计*/
        $("#fewPens").html($(".table-bordered").eq(0).find("tbody tr").length)
        var money=0;
        var amount=$(".table-bordered tbody .rechargeAmount");
        for(var i=0;i<amount.length;i++){
            money+=parseFloat($(amount).eq(i).html());
        }
        $("#recharge").html(money);

        /*拉卡拉合计*/
        var money2=0;
        var amount2=$(".table-bordered tbody .counterMoney");
        for(var i=0;i<amount2.length;i++){
            money2+=parseFloat($(amount2).eq(i).html());
        }
        $("#settlement").html(money2);

        var money3=0;
        var amount3=$(".table-bordered tbody .settlementMoney");
        for(var i=0;i<amount3.length;i++){
            money3+=parseFloat($(amount3).eq(i).html());
        }
        $("#counterFee").html(money3);
    })
</script>
<include file="Public/foot" />